package api

import (
	"github.com/gin-gonic/gin"
	"group-chat/api/handler"
	"group-chat/api/middleware"
	"group-chat/pkg/jwt"
)

func LoadRouter(r *gin.Engine) {
	r.Use(middleware.Logger())
	user := r.Group("/user")
	{
		user.POST("/login", handler.Login)
		user.Use(jwt.JWTAuth("2209A"))
		user.POST("/upload", handler.Upload)
		user.POST("/ws", handler.Echo)
		user.POST("/addArticle", handler.Article)
	}
}
